package com.uwlaser.rest;

import com.uwlaser.annotation.Log;
import com.uwlaser.domain.AntonRecordParam;
import com.uwlaser.service.AntonRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangwei
 * @create 2022/11/30
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "安东查询日志")
@RequestMapping("/api/antonRecord")
public class AntonRecordController {
    @Autowired
    private final AntonRecordService antonRecordService;

    @GetMapping
    @Log("查询安东日志")
    @ApiOperation("查询安东日志")
    @PreAuthorize("@el.check('antonRecord:list')")
    public ResponseEntity query(AntonRecordParam query, Pageable pageable){
        return new ResponseEntity<>(antonRecordService.queryByParam(query,pageable), HttpStatus.OK);
    }
}
